// index.js
Page({
  data: {
    imagelist:[],
    swiperarr: [
    ],
    entrylist: [{
        id: '1',
        text: '高清壁纸',
        bgurl: 'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/%E6%A8%AA%E5%B1%8F/%E5%8A%A8%E6%BC%AB/1.jpg?sign=f053ba5681138414a777d21de70d44d6&t=1677330212',
        path: '../bizhi/index'
      },
      {
        id: '2',
        text: '游戏达人',
        bgurl: 'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/my-photo.png?sign=59dbe211488f7cc24a8a8e47f0d6a26e&t=1677330773',
        path: '../gamepage/index'
      },
      {
        id: '3',
        text: '影视查询',
        bgurl: 'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/%E6%A8%AA%E5%B1%8F/%E5%8A%A8%E6%BC%AB/4.jpg?sign=efcbd55691078fc2e327ace3dd1e9e3b&t=1677330853',
        path: '../zhuiju/index'
      },
      {
        id: '4',
        bgurl: 'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/lizhen.jpg?sign=0d064b73e14816275409282304ef0dad&t=1737422919',
        text: '我的简历',
        path: '../myintro/index'
      },
      {
        id: '5',
        bgurl: 'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/image/bgImage/1.jpeg?sign=bb7aabd21648ae2ad3205b2314f41749&t=1737447588',
        text: '小世界i',
        path: '../mybokee/index'
      },
      {
        id: '6',
        bgurl: 'https://636c-cloud1-0g61swsq1178bf0e-1316980158.tcb.qcloud.la/images/2.jpg?sign=7b7e16457c54296dbfca22cc00997aed&t=1677724700',
        text: '诗词歌赋',
        path: '../newspage/index'
      }
    ],
    intro: '<span class="zongzhititle">暮暮云端共享：</span>主打开心就好。，我们<span class="zongzhititle">专</span>开心就好。开心就好。<span class="zongzhititle">开心就好。</span>开心就好。',
    zongzhi: '<span class="zongzhititle">我们的宗旨是：</span>开心就好。<span class="zongzhititle">开心就好。</span>开心就好。!',
    interval: 3000,
    title1: '>>精彩推荐<<',
    title2: '>>小程序介绍<<',
    title3: '>>超级弹幕<<',
    logo: '假装这有个logo',
    danmuflag:false,
    danmu:'',
    colorselect:{
      0:'red',
      1:'#21f804',
      2:'blue',
      3:'yellow',
      4:'white',
    },
    danmucolor:'red',
    direction:'true',
    showInfo:false
  },
  
    //读取数据库的值 将路径赋值到data
    getupimglist(){
      wx.cloud.callFunction({
        name:'getupimglist',
      })
      .then(res=>{
        this.setData({
          swiperarr:res.result.data
        })
      })
    },
  
 onShow(){
   let that=this
  wx.getStorage({
    key:'userpaw',
    success(res){
      that.setData({
        showInfo: res.data=='李震'?true:false,
      })
    },
    fail(){
      that.setData({
        showInfo:false
      })
    }
  })
    
 },
  onShareAppMessage() {
    return {
      title: '暮暮云端资源共享',
      path: '/pages/index/index'
    }
  },
  onReady() {

  },
  onLoad(){
    this.getupimglist()
  },
  navto(e) {
    wx.navigateTo({
      url: e.target.dataset.path,
    })
  },
  
  bindtap(e){
    console.log();
    wx.navigateTo({
      url: `../game/${e.currentTarget.dataset.path}/index`,
    })
  },
  tomytime(){
    console.log(111);
    wx.navigateTo({
      url: `/packageA/pages/mytime/index`,
    })
  },
  hidedanmu(e){
    this.setData({
      danmuflag:false
    })
  },
  showdanmu(){
    this.setData({
      danmuflag:true,
      direction:true
    })
  },
  setdanmu(e){
    this.setData({
      danmu: e.detail.value
    })
  },
  //弹幕颜色
  changecolor(e){
    this.setData({
      danmucolor:this.data.colorselect[e.target.dataset.color]
    })
  },
  hengping(){
    this.setData({
      danmuflag:true,
      direction:false
    })
  }
})